<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:composite="http://java.sun.com/jsf/composite">

<composite:interface>
	<composite:attribute name="title" />
	<composite:attribute name="title_" />

	<composite:attribute name="lastname" />
	<composite:attribute name="lastname_" />

	<composite:attribute name="email" />
	<composite:attribute name="email_" />

	<composite:attribute name="password" />
	<composite:attribute name="password_" />

	<composite:attribute name="password2" />
	<composite:attribute name="password2_" />

	<composite:attribute name="shortAddress" />
	<composite:attribute name="shortAddress_" />

	<composite:attribute name="country" />
	<composite:attribute name="country_" />
	<composite:attribute name="selectCountry" />
	<composite:attribute name="selectedCountries_" />

	<composite:attribute name="city" />
	<composite:attribute name="city_" />
	<composite:attribute name="selectCity" />
	<composite:attribute name="selectedCities_" />

	<composite:attribute name="district" />
	<composite:attribute name="district_" />
	<composite:attribute name="selectDistrict" />
	<composite:attribute name="selectedDistricts_" />

	<composite:attribute name="submitButton" />
	<composite:attribute name="submitButtonAction"
		method-signature="java.lang.String action()" />
</composite:interface>

<composite:implementation>
	<h:form>

		<h:panelGrid columns="3">
 
				#{cc.attrs.name} : 
				<h:inputText id="name" value="#{cc.attrs.name_}" size="20"
				required="true" label="#{cc.attrs.name}">
			</h:inputText>

			<h:message for="name" style="color:red" />
				
				#{cc.attrs.lastname} : 
				<h:inputText id="lastname" value="#{cc.attrs.lastname_}" size="20"
				required="true" label="#{cc.attrs.lastname}">
			</h:inputText>

			<h:message for="lastname" style="color:red" />
				
				#{cc.attrs.email} : 
				<h:inputText id="email" value="#{cc.attrs.email_}" size="20"
				required="true" label="#{cc.attrs.email}">
			</h:inputText>

			<h:message for="email" style="color:red" />
				
				#{cc.attrs.password} : 
				<h:inputText id="password" value="#{cc.attrs.password_}" size="20"
				required="true" label="#{cc.attrs.password}">
			</h:inputText>

			<h:message for="password" style="color:red" />
				
				#{cc.attrs.password2} : 
				<h:inputText id="password2" value="#{cc.attrs.password2_}" size="20"
				required="true" label="#{cc.attrs.password2}">
			</h:inputText>

			<h:message for="password2" style="color:red" />
 
				#{cc.attrs.shortAddress} : 
				<h:inputTextarea id="shortAddress" value="#{cc.attrs.shortAddress_}"
				cols="30" rows="5" required="true" label="#{cc.attrs.shortAddress}">
			</h:inputTextarea>

			<h:message for="shortAddress" style="color:red" />
				
				#{cc.attrs.country}:
				<h:selectOneMenu id="country" value="#{cc.attrs.country_}"
				required="true">
				<f:selectItem itemLabel="#{cc.attrs.selectCountry}" itemValue="" />
				<f:selectItems value="#{cc.attrs.selectedCountries_}" var="c"
					itemLabel="#{c.name}" itemValue="#{c.countryId}" />
				<f:ajax event="change" render="city" />
			</h:selectOneMenu>

			<h:message for="country" style="color:red" />
   				
   				#{cc.attrs.city}:
				<h:selectOneMenu id="city" value="#{cc.attrs.city_}" required="true">
				<f:selectItem itemLabel="#{cc.attrs.selectCity}" itemValue="" />
				<f:selectItems value="#{cc.attrs.selectedCities_}" var="c"
					itemLabel="#{c.name}" itemValue="#{c.cityId}" />
				<f:ajax event="change" render="district" />
			</h:selectOneMenu>

			<h:message for="city" style="color:red" />
   				
   				#{cc.attrs.district}:
				<h:selectOneMenu id="district" value="#{cc.attrs.district_}"
				required="true">
				<f:selectItem itemLabel="#{cc.attrs.selectDistrict}" itemValue="" />
				<f:selectItems value="#{cc.attrs.selectedDistricts_}" var="c"
					itemLabel="#{c.name}" itemValue="#{c.districtId}" />
			</h:selectOneMenu>

			<h:message for="district" style="color:red" />


		</h:panelGrid>

		<h:commandButton value="#{cc.attrs.submitButton}"
			action="#{cc.attrs.submitButtonAction}" />


	</h:form>

</composite:implementation>


</html>